package com.yangguang.service.impl;

import com.yangguang.mapper.ExamMapper;
import com.yangguang.pojo.Exam;
import com.yangguang.service.ExamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ExamServiceImpl implements ExamService {
    @Autowired
    private ExamMapper   examMapper;
    @Override
    public boolean insertExam(String examName, Integer subjectId, Integer subjectiveNumber, Integer objectiveNumber) {
        boolean flag=false;
        Exam exam = new Exam(null, examName, subjectId, subjectiveNumber, objectiveNumber);
        int insert = examMapper.insert(exam);
        if (insert>0){
            flag=true;
        }
        return flag;
    }
}
